<template>
	<view class="uni_box home">
		<!-- <navbar title=''>
		</navbar> -->
		<view class="content">
			<!-- <image class="img_bjtuan" src="/static/img/img_bj.png"></image> -->
			<view class="qianview">
				<view class="jione">
					<image class="icon_back" src="/static/img/icon_backtwo.png" @click="getfan"></image>
					<view class="huoview">
						<image class="huodong" src="/static/img/yaohead.png"></image>
						<image class="hongbao" src="/static/img/hongbao.png"></image>
					</view>
				</view>
				<view class="htwo">
					<view class="yaoone">
						<text class="yaotit">我的好友</text>
						<view class="yaohong" @click="getyaoqing">
							<image class="icon_yq" src="/static/img/icon_yq.png"></image>
							<text class="yaobiao">邀请好友</text>
						</view>
					</view>
					<view class="yaotwo">
						<view class="yaoren" @click="getzhi('zhitui')">
							<text class="rennum">{{ info.zhitui_nums||0 }}</text>
							<text class="rentui">直推好友</text>
						</view>
						<view class="yaoren"  @click="getzhi('jiantui')">
							<text class="rennum">{{ info.jiantui_nums||0 }}</text>
							<text class="rentui">间推好友</text>
						</view>
						<view class="yaoren"  @click="getzhi('team')">
							<text class="rennum">{{ info.team_nums||0 }}</text>
							<text class="rentui">团队好友</text>
						</view>
					</view>
					<view class="yaojindu">
						<view class="jins" :style="{ width: jindu+'%' }">
							<image class="icon_jd" src="/static/img/icon_jd.png"></image>
						</view>
					</view>
					<view class="jinmiao">
						<text class="yiwan">已完成进度：{{info.nums}}/{{ info.count }}</text>
						<text class="zaiyao">{{info.bfb_text}}</text>
					</view>
				</view>
				<view class="htwo">
					<view class="yaoone">
						<text class="yaotit">昨日活跃</text>
						<view class="yaohong" @click="getling">
							<image class="icon_yq" src="/static/img/icon_jltwo.png"></image>
							<text class="yaobiao">{{info.button_text}}</text>
						</view>
					</view>
					<view class="yaotwo">
						<view class="yaoren">
							<text class="rennumtwo">{{ info.yesterday_zhitui_jiesuo }}</text>
							<text class="rentui">直推好友</text>
						</view>
						<view class="yaoren">
							<text class="rennumtwo">{{ info.yesterday_jiantui_jiesuo }}</text>
							<text class="rentui">间推好友</text>
						</view>
						<view class="yaoren">
							<text class="rennumtwo">{{ info.yesterday_team_jiesuo }}</text>
							<text class="rentui">团队好友</text>
						</view>
					</view>
				</view>
				<view class="htwo" v-if="content">
					<u-parse :html="content"></u-parse>
				</view>
				
				
				</view>
			</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				teaminfo:[],
				ftxtcont:{},
				info:{},
				list:[
					{id:1,name:'邀好友、每日得奖励',biaoqian:'好友每日浏览1次项目',bianqian2:'即可获得1元奖励、间推团队也有哦~~',img:'/static/img/imgone.png'}
				],
				content:'',
				jindu:0
			}
		},
		onLoad() {
			this.getinit();
			this.getxieyi()
			// this.ftxt();//富文本
			// this.fgetMyTeamContent();//获取上面信息
		},
		onShow() {
		},
		methods: {
			async ftxt(){
				let res = await this.$u.api.getContent({
					code:'my-team'
				});
				this.ftxtcont = res
			},
			async getinit(){
				let res = await this.$u.api.getYaoInfo({
				});
				this.info = res
				this.jindu = Number(this.info.nums)/Number(this.info.count)*100
				// console.log(this.jindu)
			},
			getji(e){
				console.log("+++")
				this.navrouter("/pages_subject/twoPage/MyTeamList?type="+e);
			},
			getfan(){
				uni.navigateBack()
			},
			getyao(){
				this.navrouter('/pages/TPage/YaoPage')
			},
			listClick(e){
				if(e == 1){
					this.navrouter("/pages_subject/twoPage/LaXin");
				}else if(e == 2){
					//
				}else if(e == 3){
					//
				}else if(e == 4){
					//
				}
			},
			async getling(){
				console.log(this.info)
				if(this.info.button_type == 0){
					this.$u.toast("未解锁");
					return false;
				}
				let res = await this.$u.api.doJiang({
				})
				console.log(res)
				this.$u.toast("领取成功");
			},
			getyaoqing(){
				this.getyao()
			},
			async getxieyi(){
				let res = await this.$u.api.getContent({
					code:'yaohaoyouguize'
				});
				this.content = res.content
			},
			getzhi(e){
				this.navrouter("/pages_subject/twoPage/MyTeamList?leitype="+e);
			}
		}
	}
</script>

<style lang="scss" scoped>
	page{
		background-color: #FDEFEF;
	}
	.content{
		min-height: 100vh;
		background-color: #FDEFEF;
		position: relative;
		.img_bjtuan{
			position: absolute;
			width: 100%;
			height: 100%;
		}
		.qianview{
			position: relative;
			.jione{
				position: relative;
				display: flex;
				flex-direction: row;
				align-items: center;
				justify-content: flex-start;
				// padding: 30rpx 0 0 30rpx;
				height: 408rpx;
				
			}
			.img_hb{
				position: absolute;
				width: 100%;
				height: 100%;
			}
			.huoview{
				position: relative;
				width: 100%;
				height: 100%;
				display: flex;
				align-items: center;
				padding-left: 50rpx;
				.huodong{
					width: 297rpx;
					height: 110rpx;
					position: relative;
				}
				.hongbao{
					position: absolute;
					width: 400rpx;
					height: 400rpx;
					bottom: -50px;
					right: 0px;
				}
			}
			.icon_back{
				width: 40rpx;
				height: 40rpx;
				position: absolute;
				left: 30rpx;
				top: 30rpx;
				// #ifdef APP-PLUS
				top: calc(var(--status-bar-height) + 30rpx);
				// #endif
				z-index: 1;
			}
			.htit{
				font-family: PingFang SC;
				font-weight: bold;
				font-size: 36rpx;
				color: #FFFFFF;
			}
			.jiview{
				margin-left: auto;
				width: 126rpx;
				height: 60rpx;
				background: rgba(0,0,0,0.2);
				border-radius: 30rpx 0rpx 0rpx 30rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				.jilu{
					width: 44rpx;
					height: 44rpx;
					margin-right: 4rpx;
				}
				.jitit{
					font-family: PingFang SC;
					font-weight: 500;
					font-size: 24rpx;
					color: #FFFFFF;
				}
			}
		}
		.htwo{
			position: relative;
			padding: 0 20rpx;
			background: #FFFFFF;
			border-radius: 24rpx;
			margin: 0 30rpx 30rpx;
			padding: 30rpx;
			.yaoone{
				display: flex;
				flex-direction: row;
				align-items: flex-start;
				.yaotit{
					font-weight: bold;
					font-size: 32rpx;
					color: #111111;
				}
				.yaohong{
					display: flex;
					align-items: center;
					justify-content: center;
					background: linear-gradient(-82deg, #F04989, #FD1D55);
					border-radius: 12rpx;
					padding: 10rpx 20rpx;
					margin-left: auto;
					.icon_yq{
						width: 28rpx;
						margin-right: 7rpx;
						height: 28rpx;

					}
					.yaobiao{
						font-weight: 500;
						font-size: 24rpx;
						color: #FFFFFF;
					}
				}
			}
			.yaotwo{
				display: flex;
				flex-direction: row;
				margin: 30rpx 0;
				.yaoren{
					width: 33.33%;
					display: flex;
					flex-direction: column;
					align-items: center;
					justify-content: center;
					.rennum{
						font-weight: bold;
						font-size: 40rpx;
						color: #000011;
						display: block;
						margin-bottom: 5rpx;
					}
					.rennumtwo{
						font-weight: bold;
						font-size: 36rpx;
						color: #000011;
						display: block;
						margin-bottom: 5rpx;
					}
					.rentui{
						font-weight: 500;
						font-size: 24rpx;
						color: #C07F7F;
					}
				}
			}
			.yaojindu{
				width: 620rpx;
				height: 24rpx;
				background: #FFE1E7;
				border-radius: 12rpx;
				position: relative;
				display: flex;
				align-items: center;
				.jins{
					height: 24rpx;
					background: #FE353F;
					border-radius: 12rpx;
					width: 0%;
					position: relative;
					.icon_jd{
						position: absolute;
						width: 50rpx;
						height: 50rpx;
						right: 0;
						right: -16px;
						top: -7px;
					}
				}
			}
			.jinmiao{
				display: flex;
				flex-direction: row;
				align-items: center;
				margin-top: 30rpx;
				.yiwan{
					font-weight: 500;
					font-size: 24rpx;
					color: #333333;
				}
				.zaiyao{
					margin-left: auto;
					font-weight: 500;
					font-size: 20rpx;
					color: #999999;
				}
			}
		}
		
		.tone{
			margin: 45rpx;
			position: relative;
			// height: 690rpx;
			height: 420px;
			// padding: 0 0 0 30rpx;
			.tnav{
				position: absolute;
				width: 100%;
				height: 100%;

			}
			.toneview{
				position: relative;
				width: 100%;
				height: 100%;
				display: flex;
				flex-direction: column;

			}
			.tbiao{
				font-family: PingFang SC;
				font-weight: bold;
				font-size: 28rpx;
				color: #FBE062;
				display: flex;
				align-items: center;
				justify-content: center;
				height: 43px;
				margin-bottom: 50rpx;

			}
			.futxt{
				padding: 30rpx;
			}
			.tming{
				// margin-top: 60rpx;
				margin-bottom: 20rpx;
				display: flex;
				flex-direction: row;
				align-items: center;
				.mname{
					font-family: Source Han Sans CN;
					font-weight: bold;
					font-size: 60rpx;
					color: #F52517;
					width: 18%;
					display: flex;
					align-items: center;
					justify-content: center;
				}
				.mright{
					flex: 1;
					padding: 30rpx 30rpx;
					background: #F2EDDF;
					border-radius: 16rpx;
					margin-right: 40rpx;
					text{
						display: block;
						font-family: PingFang SC;
						font-weight: 500;
						font-size: 26rpx;
						color: #F52517;
						display: block;
						margin-bottom: 4rpx;
					}
					text:last-child{
						margin-bottom: 0;
					}
				}
			}
		}
		.ttwo{
			position: relative;
			margin: 100rpx 60rpx 30rpx;
			height: 116rpx;
			.btn_an{
				position: absolute;
				width: 100%;
				height: 100%;
			}
			.yaoview{
				position: relative;
				width: 100%;
				height: 100%;
				display: flex;
				align-items: center;
				justify-content: center;
				font-family: PingFang SC;
				font-weight: bold;
				font-size: 32rpx;
				color: #6C420C;
			}
		}

		.tthree{
			padding: 0 30rpx;
			display: flex;
			flex-direction: column;
			.youlist{
				display: flex;
				flex-direction: row;
				justify-content: space-between;
				.youitem{
					width: 48%;
					padding: 20rpx 30rpx;
					background: #FFFFFF;
					border-radius: 20rpx;
					display: flex;
					flex-direction: column;
					.youone{
						display: flex;
						flex-direction: row;
						align-items: center;
						.oneicon{
							width: 32rpx;
							height: 32rpx;
							margin-right: 8rpx;
						}
						.yitit{
							font-family: PingFang SC;
							font-weight: bold;
							font-size: 28rpx;
							color: #000000;
						}
					}
					.yname{
						display: block;
						font-family: PingFang SC;
						font-weight: 500;
						font-size: 24rpx;
						color: #666666;
						margin-top: 10rpx;
					}
					.ynum{
						color: #F54320;
						display: inline-block;
						margin: 0 4rpx;
						font-size: 32rpx;
					}
				}
				.ml{
					margin-left: auto;
				}
			}
			.jiviewbot{
				display: flex;
				flex-direction: row;
				padding-bottom: 40rpx;
				margin-top: 50rpx;
				align-items: center;
				.jiitem{
					width: 50%;
					display: flex;
					align-items: center;
					justify-content: center;
					flex-direction: column;
					.img_yj{
						width: 110rpx;
						height: 110rpx;
						margin-bottom: 9rpx;
					}
					.yjname{
						font-family: PingFang SC;
						font-weight: bold;
						font-size: 24rpx;
						color: #FFFFFF;
					}
					.yjnum{
						font-weight: bold;
						font-size: 36rpx;
						color: #FFFFFF;
					}
				}
				.shu{
					display: inline-block;
					width: 2rpx;
					height: 50rpx;
					background: #EEEEEE;
					opacity: 0.5;
				}
			}
		}
	}
	
</style>
